<script type="text/javascript">
				function search(){
				$.ajax({
											type: "POST",
											url: "<?php echo $BASE_URL; ?>search",
											data:{'func':'search','where':$("#where_sel").val(),'src':$("#src_txt").val()},
											success: function(str) {
											$("#search_result").html(str);
				}
					});
								return false;
				}
				
				
				
								var intervalID;
							function chk(){
		//	alert("OK");
				search();
				clearInterval(intervalID);
			}				
				function autoSearch(){
					var txt = ($("#src_txt").val());
						clearInterval(intervalID);
				if(txt !=""){
					intervalID = setInterval(chk,1000);
				}
			
				}
				
				
				function showEmPic(obj){
				var em_pic = 'LPN'+obj + '.jpg';
	
			//	alert(em_pic);
	  $("#em_pic").attr("src","http://www.lpnis.com/hrportal/application/employees/Picture/"+em_pic);
				}
				
				
				function sel(_id){
						location.href='<?php echo $BASE_URL;?>download_vcard/'+_id;
				}
</script>
<div id='page'> 
    <div id='header'>
			<span class='typeface-js font-23' style='font-size:50px;'>ข้อมูลพนักงานบริษัท</span>
    </div>
		
		<div align='center'>
						<form id="search_frm" action="index.php" name="search_frm" onsubmit="return search();">
						<table>
									<tr>
											<td>ค้นหา:</td>
											<td><input type="text"  name="src_txt" id="src_txt" value="" onkeyup="autoSearch()"/></td>
											<td>
														<select name="where_sel" id="where_sel" onchange="search()">
																	<option value="EORG_04">ฝ่าย</option>
																	<option value="EM_TNAME">ชื่อ</option>
																	<option value="EM_TSURNAME">สกุล</option>
																	<option value="EM_CODE">รหัสพนักงาน</option>
																	<option value="EM_NICKNAME">ชื่อเล่น</option>
																	<option value="EM_TEL">เบอร์โทร</option>
																	<option value="EM_MAIL">Login</option>
														</select>
											</td>
											<td><input type="submit" value="ค้นหา"/></td>
									</tr>
						</table>
						</form>
						<div id='search_result' style="overflow:auto; width:500px; height:300px; padding-left:50px;"></div>
		</div>

   <div style='clear:both;'></div>
</div>
<p style="color:#ccc; font-size:11px; text-align:center;">
Page rendered in <strong>{elapsed_time}</strong> seconds
	</p>